<%--
  Created by IntelliJ IDEA.
  User: hp
  Date: 2021/4/21
  Time: 22:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>学生列表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/manster.css"/>
</head>
<body>

<div class="ui attached pointing menu">
    <div class="ui container">
        <div class="right menu">
            <a href="${pageContext.request.contextPath}/add" class="item">新增</a>
            <a href="${pageContext.request.contextPath}/list" class="active blue item">列表</a>
        </div>
    </div>
</div>

<!-- 中间内容 -->
<div class="m-container-small m-padded-tb-large">
    <div class="ui container">
        <form action="${pageContext.request.contextPath}/search" method="post" class="ui form">
            <div class="inline fields">
                <div class="field">
                    <input type="text" id="name" name="name" placeholder="学生姓名" />
                </div>
                <div class="field">
                    <button id="searchbtn" class="ui teal basic button"><i class="search icon"></i>搜索</button>
                </div>
            </div>
        </form>
        <table class="ui celled table">
            <thead>
            <tr class="center aligned">
                <th>学生ID</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>学号</th>
                <th>地址</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
                <c:forEach var="stu" items="${students}">
                <tr class="center aligned">
                    <td>${stu.id}</td>
                    <td>${stu.name}</td>
                    <td>${stu.age}</td>
                    <td>${stu.gender}</td>
                    <td>${stu.number}</td>
                    <td>${stu.address}</td>
                    <td>${stu.status}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/update?id=${stu.id}" class="ui mini blue button">编辑</a>
                        <a href="${pageContext.request.contextPath}/delete?id=${stu.id}" class="ui mini red button">删除</a>
                    </td>
                </tr>
                </c:forEach>
            </tbody>
            <tfoot>
            <tr class="center aligned">
                <th colspan="8">
                    <div class="ui small pagination menu">
                        <a class="icon item">
                            <i class="left chevron icon">上一页</i>
                        </a>
                        <a class="item">1</a>
                        <a class="item">2</a>
                        <a class="item">3</a>
                        <a class="item">4</a>
                        <a class="icon item">
                            <i class="right chevron icon">下一页</i>
                        </a>
                    </div>
                    <a href="${pageContext.request.contextPath}/add" class="ui small right floated violet basic button">新增</a>
                </th>
            </tr></tfoot>
        </table>
    </div>
</div>

<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.js"></script>
<script src="${pageContext.request.contextPath}/static/js/semantic.min.js"></script>
<script type="text/javascript">
</script>
</body>
</html>
